/**
 * 
 */
package com.wolfpire.proms.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.wolfpire.system.common.Constants;
import com.wolfpire.system.common.UnCover;

/**
 * 任务计划
 * @author lihd
 *
 */

@Entity
@Table(name = "t_task_plan")
public class TaskPlan implements Serializable {
	
	private static final long serialVersionUID = -2226624858304194396L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id", unique = true, nullable = false, length = 16)
	private Long id;//主键Id
	
	@Column(name = "task_id", length = 16)
	private Long taskId; //任务Id
	
	@Column(name = "name", length = 255)
	private String name;//名称(主题)
	
	@Column(name = "remark", length = 255)
	private String remark; //内容
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "start_time")
	@DateTimeFormat(pattern="yyyy-MM-dd")  
	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") 
	private Date startTime;//计划开始时间
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "end_time")
	@DateTimeFormat(pattern="yyyy-MM-dd")  
	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") 
	private Date endTime;//计划结束时间
	
	@Column(name = "create_user_id")
	private Long createUserId;
	
	@Column(name = "create_user_name")
	private String createUserName;
	
	@UnCover
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time")
	@DateTimeFormat(pattern="yyyy-MM-dd")  
	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") 
	private Date createTime = new Date();//创建时间
	
	@Column(name = "update_user_id")
	private Long updateUserId;
	
	@Column(name = "update_user_name")
	private String updateUserName;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_time")
	@DateTimeFormat(pattern="yyyy-MM-dd")  
	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") 
	private Date updateTime = new Date();
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "finish_time")
	@DateTimeFormat(pattern="yyyy-MM-dd")  
	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") 
	private Date finishTime;
	
	@Column(name = "del_flag", length = 1)
	private Integer delFlag = Constants.NORMAL_FLAG;
	
	@Transient
	private String ids; //任务计划id串，仅供页面传值，以及持久层查询使用
	
	@Column(name = "plan_actor_id", length = 20)
	private String planActorId; //负责人Id
	
	@Column(name = "plan_actor_name", length = 20)
	private String planActorName; //参与者名称

	@Column(name = "plan_amount", length = 20)
	private String planAmount;// 计划使用资金
	
	@Column(name = "status", length = 4)
	private Integer status; //参与者Id
	
	@Column(name = "expect_result", length = 255)
	private String expectResult;
	
	@Column(name = "is_timeout", length = 4)
	private Integer isTimeout; //参与者Id
	
	@Transient
	private Task task;
	
	public Task getTask() {
		return task;
	}

	public void setTask(Task task) {
		this.task = task;
	}

	public TaskPlan() {
		super();
	}

	public TaskPlan(Long id, Long taskId, String name, String remark,
			Date startTime, Date endTime, Date createTime, Long createUserId,
			String createUserName, Integer delFlag,String planActorId,String planActorName,String planAmount, 
			Integer status ,String expectResult) {
		super();
		this.id = id;
		this.taskId = taskId;
		this.name = name;
		this.remark = remark;
		this.startTime = startTime;
		this.endTime = endTime;
		this.createTime = createTime;
		this.createUserId = createUserId;
		this.createUserName = createUserName;
		this.delFlag = delFlag;
		this.planActorId = planActorId;
		this.planActorName = planActorName;
		this.planAmount = planAmount;
		this.status = status;
		this.expectResult = expectResult;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getTaskId() {
		return taskId;
	}

	public void setTaskId(Long taskId) {
		this.taskId = taskId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Long getCreateUserId() {
		return createUserId;
	}

	public void setCreateUserId(Long createUserId) {
		this.createUserId = createUserId;
	}

	public String getCreateUserName() {
		return createUserName;
	}

	public void setCreateUserName(String createUserName) {
		this.createUserName = createUserName;
	}

	public Integer getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(Integer delFlag) {
		this.delFlag = delFlag;
	}

	public Long getUpdateUserId() {
		return updateUserId;
	}

	public void setUpdateUserId(Long updateUserId) {
		this.updateUserId = updateUserId;
	}

	public String getUpdateUserName() {
		return updateUserName;
	}

	public void setUpdateUserName(String updateUserName) {
		this.updateUserName = updateUserName;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getIds() {
		return ids;
	}

	public void setIds(String ids) {
		this.ids = ids;
	}

	public String getPlanActorId() {
		return planActorId;
	}

	public void setPlanActorId(String planActorId) {
		this.planActorId = planActorId;
	}

	public String getPlanActorName() {
		return planActorName;
	}

	public void setPlanActorName(String planActorName) {
		this.planActorName = planActorName;
	}

	public String getPlanAmount() {
		return planAmount;
	}

	public void setPlanAmount(String planAmount) {
		this.planAmount = planAmount;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getExpectResult() {
		return expectResult;
	}

	public void setExpectResult(String expectResult) {
		this.expectResult = expectResult;
	}

	public Integer getIsTimeout() {
		return isTimeout;
	}

	public void setIsTimeout(Integer isTimeout) {
		this.isTimeout = isTimeout;
	}

	public Date getFinishTime() {
		return finishTime;
	}

	public void setFinishTime(Date finishTime) {
		this.finishTime = finishTime;
	}
	
}
